package org.jiangy.usercenter.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.ColumnDefault;

import java.io.Serializable;
import java.time.Instant;

/**
 * 经销商
 * <p>创建时间: 2024/8/14 </p>
 *
 * @author <a href="mailto:jiangliu0316@outlook.com" rel="nofollow">蒋勇</a>
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@Getter
@Setter
@Entity
public class Reseller implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    private String storeName;
    private String storeUrl;
    private String orderPromptSound;
    @Column(name = "is_allow_purchase")
    private boolean allowPurchase;
    @Column(name = "is_agree_policy")
    private boolean agreePolicy;

    @ColumnDefault("0")
    private boolean isDeleted;
    private Instant deletedAt;

    @JsonIgnore
    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "customer_id")
    private Customer customer;
}
